<?php
/**
* エラーチェッククラス
**/
require_once( '../system/Class_M_DAO.php' );
class Class_M_MATRIX_VER extends Class_M_DAO {
	//protected properties begin
	/**
	 *
	 * テーブル名
	 *
	 * @access    protected
	 * @var       string
	 *
	 */
	protected $_table = "M_MATRIX_VER";
	
	/**
	 *
	 * 主キー名
	 *
	 * @access    protected
	 * @var       string
	 *
	 */
	protected $_pkey = "id";
	
	/**
	 *
	 * ソート順
	 *
	 * @access    protected
	 * @var       string
	 *
	 */
	 protected $_order = "matrix_cd, groupid";
	 
	 protected $_cols     = array(
		"matrix_cd"       => array(AOKI_VARTYPE_STR),
		"groupid"         => array(AOKI_VARTYPE_INT),
		"verno"        	  => array(AOKI_VARTYPE_STR),
		"title"           => array(AOKI_VARTYPE_STR),
		"titlecell"       => array(AOKI_VARTYPE_STR),
		"color"           => array(AOKI_VARTYPE_STR),
		"sale_name"       => array(AOKI_VARTYPE_STR),
		"oper"            => array(AOKI_VARTYPE_STR),
		"size"            => array(AOKI_VARTYPE_STR),
		"contractor"      => array(AOKI_VARTYPE_STR),
		"print"           => array(AOKI_VARTYPE_STR),
		"area_id"         => array(AOKI_VARTYPE_INT),
		"area"            => array(AOKI_VARTYPE_STR),
		"pattern_cd"      => array(AOKI_VARTYPE_INT),
		"mano_out"        => array(AOKI_VARTYPE_STR),
		"mano_in"         => array(AOKI_VARTYPE_STR),
		"map"             => array(AOKI_VARTYPE_STR),
		"perweekver"      => array(AOKI_VARTYPE_STR),
		"saletickt"       => array(AOKI_VARTYPE_STR),
		"exp_ins_flg"     => array(AOKI_VARTYPE_STR),
		"exp_ins_week"    => array(AOKI_VARTYPE_DATE),
		"memo"            => array(AOKI_VARTYPE_STR),
		"user_flag"       => array(AOKI_VARTYPE_STR)
	 );


	 protected $_checks  = array(
	 	"verno"                => array( "EXIST"),
		"title"                => array( "EXIST"),
		"color"                => array( "EXIST"),		
		"sale_name"            => array( "EXIST"),
		"size"                 => array( "EXIST"),
		"contractor"           => array( "EXIST"),
		"mano_out"             => array( "EXIST"),
		"mano_in"              => array( "EXIST"),
	 );

	 //maxlength 
	 protected $_maxlens  = array(
		"mano_out"       => 20 ,
		"ver_no"         => 5 ,
		"mano_in"        => 20
	
	 );
	 
	 protected $_errorfields  = array(
		"title"             => "タイトル",
		"verno"             => "版番号",
		"color"             => "色",		
		"sale_name"         => "売り方",
		"size"              => "サイズ",
		"mano_out"          => "管理Noオモテ",
		"mano_in"           => "管理Noウラ" ,
		"exp_ins_week"      => "例外折込曜日",
		"area_id"           => "エリア",
		"contractor"        => "制作業者",
		"print"             => "印刷業者",
		"pattern_cd"        => "地域新聞名"
	 );
 	 public function get_errorfields() {
		return $this->_errorfields ;
	}
	
 	 public function get_matrix_chk_fields() {
		$sea_chk_fields  = array(
			"year4"           => array( "EXIST"),
			"week_cd"         => array( "EXIST")		
		);
	 return $sea_chk_fields;
	}
	
	// public function search($where ,&$page = NULL ){
	//	$sql = "SELECT a.*,(select  user_name FROM M_LOGIN where id  = a.u_user) as m_user_name from {$this->_table}  a ";
	//	return  parent::search($where ,$page ,$sql);
	//}
	

}

?>